package com.util;

import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;

/**
 * @Author:xuyuanhong
 * @Date:Created in 2022/12/8 16:38
 */
public class ResponseUtils {
    public static void renderJson(HttpServletResponse response, Object o)throws Exception {

        response.setContentType("text/html;charset=utf-8");

        PrintWriter out=response.getWriter();

        out.println(o.toString());

        System.out.println(o.toString());
        out.flush();
        out.close();

    }
}
